package org.mech.sefer.entity.bible.model.reference;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.mech.sefer.entity.bible.model.SemanticVerse;
import org.mech.sefer.entity.model.AbstractEntity;

@Entity
@Table(name = "T_REFS_VERSE_ATOM")
public class VerseAtomRef extends AbstractEntity {
	
	private static final long serialVersionUID = -1099606315065164400L;
	
	@Id
	@SequenceGenerator(name = "T_VERSE_ATOM_REFS_SEQ", sequenceName = "T_VERSE_ATOM_REFS_SEQ", allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "T_VERSE_ATOM_REFS_SEQ")
	@Column(name = "ID", nullable = false, updatable = false)
	private Long id;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "BOOK_ATOM_REF_ID")
	private BookAtomRef bookReference;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "S_VERSE_ID")
	private SemanticVerse semanticVerse;
	
	@Column(name = "RANGE_ID")
	private Integer rangeId;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public SemanticVerse getSemanticVerse() {
		return semanticVerse;
	}

	public void setSemanticVerse(SemanticVerse semanticVerse) {
		this.semanticVerse = semanticVerse;
	}

	public Integer getRangeId() {
		return rangeId;
	}

	public void setRangeId(Integer rangeId) {
		this.rangeId = rangeId;
	}

	public BookAtomRef getBookReference() {
		return bookReference;
	}

	public void setBookReference(BookAtomRef bookReference) {
		this.bookReference = bookReference;
	}

}
